# !/bin/sh
cd /sys/kernel/debug/tracing/

echo 0 > tracing_on
echo nop > current_tracer
echo function_graph > current_tracer
echo > set_ftrace_filter
echo 1 > options/funcgraph-tail

### 跟踪的函数
echo local_pci_probe > set_graph_function
### 不跟踪的函数
echo sysfs_add_file_mode_ns software_node_notify device_add_attrs dpm_sysfs_add \
    attribute_container_device_trigger_safe acpi* console* async_schedule_node \
    vprintk scsi_autopm_put_host mutex_unlock netlink_broadcast ata_print_version > set_graph_notrace

echo 1 > tracing_on

### 执行测试程序
modprobe ahci
### 执行测试程序

echo 0 > tracing_on

cat trace > /root/trace.log
cat /root/trace.log

echo > set_graph_function
echo nop > current_tracer
